package jsprintorbitor.experiment;

import jsprintorbitor.experiment.graph.AlgGenPair;
import laboratoryQ.common.IDisposable;
import laboratoryQ.computation.BaseUtils;
import laboratoryQ.experiment.settings.BaseExperimentSettings;
import laboratoryQ.experiment.settings.SettingsAnnotations.Hidden;
import laboratoryQ.experiment.settings.SettingsAnnotations.IgnoreWhenCheck;
import laboratoryQ.experiment.settings.SettingsAnnotations.Increase;

public class SpOrbExperimentSettings extends BaseExperimentSettings implements IDisposable {
	/**
	 * ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
	 * Graph traversal range number of vertices
	 */
	@IgnoreWhenCheck
	@Increase(value = 1, boundBegin = 0, boundEnd = 1)
	public boolean gtrvexSzRngEnabled = false;
	@Increase(value = 10, boundBegin = 20, boundEnd = 10000)
	public int gtrvexSzRngVrtCntBeg = -1;
	@Increase(value = 10, boundBegin = 20, boundEnd = 10000)
	public int gtrvexSzRngVrtCntEnd = -1;
	@Increase(value = 5, boundBegin = 1, boundEnd = 10000)
	public int gtrvexSzRngExpRunCnt = -1;
	@Increase(value = 0.05, boundBegin = 0, boundEnd = 100)
	public double gtrvexSzRngV2EPower = -1;
	@Increase(value = 0.1, boundBegin = 0, boundEnd = 10000)
	public double gtrvexSzRngV2EMul = -1;
	@Increase(value = 20., boundBegin = 0, boundEnd = 10000)
	public double gtrvexSzRngV2EAdd = -1;

	/**
	 * ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
	 * Graph traversal range edges count power
	 */
	@IgnoreWhenCheck
	@Increase(value = 1, boundBegin = 0, boundEnd = 1)
	public boolean gtrvexPwRngEnabled = false;
	@Increase(value = 50, boundBegin = 20, boundEnd = 10000)
	public int gtrvexPwRngVrtCnt = -1;
	@Increase(value = 10, boundBegin = 20, boundEnd = 10000)
	public int gtrvexPwRngExpRunCnt = -1;
	@Increase(value = 0.01, boundBegin = 0.5, boundEnd = 5)
	public double gtrvexPwRngBeg = -1;
	@Increase(value = 0.01, boundBegin = 0.5, boundEnd = 5)
	public double gtrvexPwRngEnd = -1;
	@Increase(value = 0.005, boundBegin = 0.01, boundEnd = 0.2)
	public double gtrvexPwRngStep = -1;
	@Increase(value = 0.1, boundBegin = 0, boundEnd = 10000)
	public double gtrvexPwRngMul = -1;
	@Increase(value = 20., boundBegin = 0, boundEnd = 10000)
	public double gtrvexPwRngAdd = -1;

	/**
	 * ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
	 * Dejkstra for shortest path problem experiment
	 */
	@IgnoreWhenCheck
	@Increase(value = 1, boundBegin = 0, boundEnd = 1)
	public boolean dejkstraPwRngEnabled = false;
	@Increase(value = 50, boundBegin = 20, boundEnd = 10000)
	public int dejkstraPwRngVrtCnt = -1;
	@Increase(value = 10, boundBegin = 20, boundEnd = 10000)
	public int dejkstraPwRngExpRunCnt = -1;
	@Increase(value = 0.01, boundBegin = 0.5, boundEnd = 5)
	public double dejkstraPwRngBeg = -1;
	@Increase(value = 0.01, boundBegin = 0.5, boundEnd = 5)
	public double dejkstraPwRngEnd = -1;
	@Increase(value = 0.005, boundBegin = 0.01, boundEnd = 0.2)
	public double dejkstraPwRngStep = -1;
	@Increase(value = 0.1, boundBegin = 0, boundEnd = 10000)
	public double dejkstraPwRngMul = -1;
	@Increase(value = 20., boundBegin = 0, boundEnd = 10000)
	public double dejkstraPwRngAdd = -1;

	// TODO: stop experiment on close
	/**
	 * ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
	 * Dinic for max flow problem experiment
	 */
	@IgnoreWhenCheck
	@Increase(value = 1, boundBegin = 0, boundEnd = 1)
	public boolean dinicPwRngEnabled = false;
	@Increase(value = 50, boundBegin = 20, boundEnd = 10000)
	public int dinicPwRngVrtCnt = -1;
	@Increase(value = 10, boundBegin = 20, boundEnd = 10000)
	public int dinicPwRngExpRunCnt = -1;
	@Increase(value = 0.01, boundBegin = 0.5, boundEnd = 5)
	public double dinicPwRngBeg = -1;
	@Increase(value = 0.01, boundBegin = 0.5, boundEnd = 5)
	public double dinicPwRngEnd = -1;
	@Increase(value = 0.005, boundBegin = 0.01, boundEnd = 0.2)
	public double dinicPwRngStep = -1;
	@Increase(value = 0.1, boundBegin = 0, boundEnd = 10000)
	public double dinicPwRngMul = -1;
	@Increase(value = 20., boundBegin = 0, boundEnd = 10000)
	public double dinicPwRngAdd = -1;
	
	/**
	 * ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
	 * Min-cost-flow experiment
	 */
	@IgnoreWhenCheck
	@Increase(value = 1, boundBegin = 0, boundEnd = 1)
	public boolean mcfPwRngEnabled = false;
	@Increase(value = 50, boundBegin = 20, boundEnd = 10000)
	public int mcfPwRngVrtCnt = -1;
	@Increase(value = 10, boundBegin = 20, boundEnd = 10000)
	public int mcfPwRngExpRunCnt = -1;
	@Increase(value = 0.01, boundBegin = 0.5, boundEnd = 5)
	public double mcfPwRngBeg = -1;
	@Increase(value = 0.01, boundBegin = 0.5, boundEnd = 5)
	public double mcfPwRngEnd = -1;
	@Increase(value = 0.005, boundBegin = 0.01, boundEnd = 0.2)
	public double mcfPwRngStep = -1;
	@Increase(value = 0.1, boundBegin = 0, boundEnd = 10000)
	public double mcfPwRngMul = -1;
	@Increase(value = 20., boundBegin = 0, boundEnd = 10000)
	public double mcfPwRngAdd = -1;

	@Hidden
	public AlgGenPair[] traversalExperimentCases = null;
	@IgnoreWhenCheck
	@Increase(value = 1, boundBegin = 0, boundEnd = 1)
	public boolean trvVirtualExpCasesEnabled = true;
	@Hidden
	public AlgGenPair[] traversalExperimentCasesVirtual = null;
	@Hidden
	public AlgGenPair[] shortestPathExperimentCases = null;
	@Hidden
	public AlgGenPair[] maxFlowExperimentCases = null;
	@Hidden
	public AlgGenPair[] minCostFlowExperimentCases = null;

	public SpOrbExperimentSettings() {
		experimentContextFactory = new SpOrbExperimentContextFactory();
		experiment = new SpOrbExperiment();
	}

	@Override
	public void dispose() {
		BaseUtils.dispose((Object[])traversalExperimentCases);
	}

	@Override
	protected void finalize() throws Throwable {
		dispose();
	}
}